﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ListPid.aspx.cs" Inherits="fsw.Web.SytemData.ListPid" ValidateRequest="false" %>
<%@ Import Namespace="fsw.Common" %>
<%@ Register Src="~/HeaderJs.ascx" TagPrefix="uc1" TagName="HeaderJs" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="renderer" content="webkit" />
    <title>数据排行</title>
    <uc1:HeaderJs runat="server" ID="HeaderJs" />
</head>
<body>
    <div class="position">当前位置：<a href="ListPid.aspx">数据排行</a></div>
    <div class="border">
        <div class="am-btn-group">
        </div>
        <div class="am-form am-form-inline am-fr">
            <select name="pId" id="pId"><%=List_Pro_Str %></select>
            <select name="UserType" id="UserType"><%=List_User_Type %></select>
            <select name="UserId" id="UserId"><%=List_User_Str %></select>
            <div class="am-form-group am-form-icon">
                <i class="am-icon-search"></i>
                <input name="txtKeywords" type="text" id="txtKeywords" value="<%=keywords %>" class="am-form-field am-input-sm" placeholder="请输入关键字" />
                <a id="lbtnSearch" class="am-btn am-btn-warning am-radius am-text-sm">搜索</a>
            </div>
        </div>
        <div class="am-cf"></div>

        <div class="am-panel am-panel-default am-margin-top">
            <div class="am-panel-hd">
                <h3 class="am-panel-title">按项目数据排行列表</h3>
            </div>
            <div class="imagelist2">
                <ul id="list">
                    <%foreach (System.Data.DataRow m in rptList.Rows){
                          if (DirFileHelper.IsExists_File(Path_File + m["PicPath"] + "/" + m["PicName"])) { 
                    %>
                    <li>
                        <div class="preview listfile" data-url="<%=Path_File + m["PicPath"] + "/" + m["PicName"] %>">
                            <img src="<%=Path_File + m["PicPath"] + "/" + m["PicName"] %>" title="<%="项目:"+m["HosName"]+"&#10路径:" + m["PicPath"]+"&#10名称:"+m["PicName"] +"&#10时间:"+ Utils.GetTime(m["AddDate"].ToString())%>" data-file="<%= m["PicPath"] %>" data-name ="<%=m["PicName"]%>"/>
                        </div>
                        <p class="file-title"><%=m["PicName"] %></p>
                    </li>
                    <%}} %>
                </ul>
            </div>
        </div>
        <div class="border-top am-padding">
            <div class="am-u-sm-10 pagelist">
                <ul>
                    <div class="am-fl"><%=PageContent %></div>
                </ul>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <script>
        $(function () {
            $('.CodeImage').on('click', function () {
                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    shadeClose: true,
                    content: '<img src="' + $(this).attr("src") + '" style="max-width:360px;">'
                });
            })
            $('#lbtnSearch').on('click', function () {
                var _pathname = window.location.pathname;
                var _pId = $('#pId').val(), _txtKeywords = $('#txtKeywords').val(), _UserId = $('#UserId').val(), _UserType = $('#UserType').val();
                var _url = [];
                if (_pId != '') _url.push('pId=' + _pId);
                if (_txtKeywords != '') _url.push('keywords=' + encodeURIComponent(_txtKeywords));
                if (_UserId != '') _url.push('UserId=' + _UserId);
                if (_UserType != "") _url.push('UserType=' + _UserType);
                if (_url.length > 0) {
                    window.location.href = '?' + _url.join('&');
                } else {
                    window.location.href = _pathname;
                }
            })
            $(".listfile").click(function (i) {
                var url = $(this).attr("data-url");
                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    shadeClose: true,
                    content: ' <img src="' + url + '" style="max-width:360px;" class="fq-copy">'
                });
            });
        })
        $(document).on('mousewheel DOMMouseScroll', onMouseScroll);
        function onMouseScroll(e) {
            var o = document.querySelector('.fq-copy');
            if (o != null) {
                var zoom = parseInt(o.style.zoom, 10) || 100;
                zoom += event.wheelDelta / 12;
                if (zoom > 0) o.style.zoom = zoom + '%';
                return false;
            }
        }
        $(function () {
            $(".listfile").find('img').hover(function () {
                var _this = $(this);
                var _title = _this.attr('title');               
                _this.attr('data-id', _title);
                var _file = _this.attr("data-file");
                var _name = _this.attr("data-name");
                $.ajax({
                    type: 'post',
                    cache: false,
                    dataType: 'json',
                    url: '/Card/CardClick.aspx',
                    data: "PicPath=" + _file + "&PicName=" + _name,
                    error: function (e) { alert(e.responseText); },
                    success: function (d) {
                        _this.attr('title', _title + '\n查看：' + d[0] + '\n复制：' + d[1]);
                    }
                })
            }, function () {
                var _this = $(this);
                var _title = _this.attr('data-id');
                _this.attr('title', _title);
            })
        })
    </script>
</body>
</html>
